<template>
  <el-container>
    <el-aside :width="sidewidth + 'px'" style="box-shadow: 2px 0 6px rgb(0 21 41 / 35%);">
      <Aside :isCollapse="isCollapse" :logoTextShow="logoTextShow"/>
    </el-aside>

    <el-container>
      <el-header style="border-bottom: 1px solid #ccc;">
        <Header :collapseBtnClass="collapseBtnClass" :collapse="collapse"/>
      </el-header>

      <el-main>
<!--        表示当前页面的子路由会在<router-view />里展示-->
        <router-view />
      </el-main>
    </el-container>
  </el-container>

</template>

<script>
  import Aside from "@/components/Aside";
  import Header from "@/components/Header";

export default {
  name: 'HomeView',
  data(){
    return {
      collapseBtnClass: 'el-icon-s-fold',
      isCollapse: false,
      sidewidth:200,
      logoTextShow:true
    }
  },
  components: {
    Header,
    Aside
  },
  methods:{
    collapse(){
      this.isCollapse = !this.isCollapse
      if (this.isCollapse){//收缩
        this.sidewidth = 64
        this.collapseBtnClass = 'el-icon-s-unfold'
        this.logoTextShow = false
      }else {//展开
        this.sidewidth = 200
        this.collapseBtnClass = 'el-icon-s-fold'
        this.logoTextShow = true
      }
    }
  }
}
</script>

